
    <html>
    <head>
    	<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<!-- 可选的Bootstrap主题文件（一般不用引入） -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="default.css" rel="stylesheet">
    </head>
        <body>
            <h2 id="centos-ssh">CENTOS SSH配置</h2>
<h3 id="ssh">修改SSH登录端口号</h3>
<ol>
<li>修改ssh配置文件</li>
</ol>
<div class="codehilite"><pre><span></span># vi /etc/ssh/sshd_config
&gt;&gt;&gt; port 9922
# vi /etc/ssh/ssh_config
&gt;&gt;&gt; prot 9922
</pre></div>


<ol>
<li>重启ssh服务</li>
</ol>
<div class="codehilite"><pre><span></span># service sshd restart
</pre></div>


<ol>
<li>使用ssh重新登录</li>
</ol>
<div class="codehilite"><pre><span></span># ssh username@IP -p prot
</pre></div>


<h3 id="sship">SSH限制用户和IP登录</h3>
<ol>
<li>修改ssh配置文件</li>
</ol>
<div class="codehilite"><pre><span></span><span class="cp"># vi /etc/ssh/sshd_config</span>
<span class="o">&gt;&gt;&gt;</span> <span class="n">allowusers</span> <span class="n">xxx</span><span class="mf">@114.80.100.159</span>
</pre></div>


<ol>
<li>重启ssh服务</li>
</ol>
<div class="codehilite"><pre><span></span># service sshd restart
</pre></div>


<h3 id="_1">指定尝试密码次数</h3>
<ol>
<li>修改ssh配置文件</li>
</ol>
<div class="codehilite"><pre><span></span># vi /etc/ssh/sshd_config
&gt;&gt;&gt; MaxAuthTries  3  #可以允许做3次尝试
</pre></div>
        </body>
    </html>
    